/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author frico
 */
@Entity
@Table(name = "lisLISTA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LisLISTA.findAll", query = "SELECT l FROM LisLISTA l"),
    @NamedQuery(name = "LisLISTA.findByCodigo", query = "SELECT l FROM LisLISTA l WHERE l.codigo = :codigo"),
    @NamedQuery(name = "LisLISTA.findByDescripcion", query = "SELECT l FROM LisLISTA l WHERE l.descripcion = :descripcion"),
    @NamedQuery(name = "LisLISTA.findByTipoLista", query = "SELECT l FROM LisLISTA l WHERE l.tipoLista = :tipoLista"),
    @NamedQuery(name = "LisLISTA.findByArticulosIncluidos", query = "SELECT l FROM LisLISTA l WHERE l.articulosIncluidos = :articulosIncluidos"),
    @NamedQuery(name = "LisLISTA.findByTipoCambio", query = "SELECT l FROM LisLISTA l WHERE l.tipoCambio = :tipoCambio"),
    @NamedQuery(name = "LisLISTA.findByPrecioUnitario", query = "SELECT l FROM LisLISTA l WHERE l.precioUnitario = :precioUnitario")})
public class LisLISTA implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "Codigo")
    private String codigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "Descripcion")
    private String descripcion;
    @Size(max = 32)
    @Column(name = "TipoLista")
    private String tipoLista;
    @Size(max = 32)
    @Column(name = "ArticulosIncluidos")
    private String articulosIncluidos;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "TipoCambio")
    private String tipoCambio;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PrecioUnitario")
    private BigDecimal precioUnitario;
    @ManyToMany(mappedBy = "lisLISTACollection")
    private Collection<ArsARTICULO> arsARTICULOCollection;
    @JoinColumn(name = "Moneda", referencedColumnName = "Codigo")
    @ManyToOne(optional = false)
    private CmpMONEDA moneda;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "listaValuacion")
    private Collection<ArsPERFILCONTABLE> arsPERFILCONTABLECollection;
    @OneToMany(mappedBy = "listaAuxiliar")
    private Collection<ArsPERFILCONTABLE> arsPERFILCONTABLECollection1;

    public LisLISTA() {
    }

    public LisLISTA(String codigo) {
        this.codigo = codigo;
    }

    public LisLISTA(String codigo, String descripcion, String tipoCambio) {
        this.codigo = codigo;
        this.descripcion = descripcion;
        this.tipoCambio = tipoCambio;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getTipoLista() {
        return tipoLista;
    }

    public void setTipoLista(String tipoLista) {
        this.tipoLista = tipoLista;
    }

    public String getArticulosIncluidos() {
        return articulosIncluidos;
    }

    public void setArticulosIncluidos(String articulosIncluidos) {
        this.articulosIncluidos = articulosIncluidos;
    }

    public String getTipoCambio() {
        return tipoCambio;
    }

    public void setTipoCambio(String tipoCambio) {
        this.tipoCambio = tipoCambio;
    }

    public BigDecimal getPrecioUnitario() {
        return precioUnitario;
    }

    public void setPrecioUnitario(BigDecimal precioUnitario) {
        this.precioUnitario = precioUnitario;
    }

    @XmlTransient
    public Collection<ArsARTICULO> getArsARTICULOCollection() {
        return arsARTICULOCollection;
    }

    public void setArsARTICULOCollection(Collection<ArsARTICULO> arsARTICULOCollection) {
        this.arsARTICULOCollection = arsARTICULOCollection;
    }

    public CmpMONEDA getMoneda() {
        return moneda;
    }

    public void setMoneda(CmpMONEDA moneda) {
        this.moneda = moneda;
    }

    @XmlTransient
    public Collection<ArsPERFILCONTABLE> getArsPERFILCONTABLECollection() {
        return arsPERFILCONTABLECollection;
    }

    public void setArsPERFILCONTABLECollection(Collection<ArsPERFILCONTABLE> arsPERFILCONTABLECollection) {
        this.arsPERFILCONTABLECollection = arsPERFILCONTABLECollection;
    }

    @XmlTransient
    public Collection<ArsPERFILCONTABLE> getArsPERFILCONTABLECollection1() {
        return arsPERFILCONTABLECollection1;
    }

    public void setArsPERFILCONTABLECollection1(Collection<ArsPERFILCONTABLE> arsPERFILCONTABLECollection1) {
        this.arsPERFILCONTABLECollection1 = arsPERFILCONTABLECollection1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigo != null ? codigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LisLISTA)) {
            return false;
        }
        LisLISTA other = (LisLISTA) object;
        if ((this.codigo == null && other.codigo != null) || (this.codigo != null && !this.codigo.equals(other.codigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.LisLISTA[ codigo=" + codigo + " ]";
    }
    
}
